From: Андрей Гриценко Date: Mon, 29 May 2023 14:42:13 +0000 (+0300) Subject: magnifier: Fix cursor offset X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~337^2~2^2~32 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ae24b0247e90aba85366b7364f7061f4ce467dc5;p=gnome-shell.git magnifier: Fix cursor offset Commit c449058d447c2588d changed the pointer clone to use a single actor. However that broke applying the hotspot translation to the position, so the magnified cursor is now displayed with a shift. Undo the change to restore the old behavior. This reverts commit c449058d447c2588de81df2e2bd7a1ae98c4060f. Part-of: --- diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index f4012dedf..bd6904758 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -103,12 +103,15 @@ var Magnifier = class Magnifier extends Signals.EventEmitter { this._mouseSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE }); this._mouseSprite.content = new MouseSpriteContent(); + this._cursorRoot = new Clutter.Actor(); + this._cursorRoot.add_actor(this._mouseSprite); + // Create the first ZoomRegion and initialize it according to the // magnification settings. [this.xMouse, this.yMouse] = global.get_pointer(); - let aZoomRegion = new ZoomRegion(this, this._mouseSprite); + let aZoomRegion = new ZoomRegion(this, this._cursorRoot); this._zoomRegions.push(aZoomRegion); this._settingsInit(aZoomRegion); aZoomRegion.scrollContentsTo(this.xMouse, this.yMouse); @@ -283,7 +286,7 @@ var Magnifier = class Magnifier extends Signals.EventEmitter { * @returns {ZoomRegion} the newly created ZoomRegion. */ createZoomRegion(xMagFactor, yMagFactor, roi, viewPort) { - let zoomRegion = new ZoomRegion(this, this._mouseSprite); + let zoomRegion = new ZoomRegion(this, this._cursorRoot); zoomRegion.setViewPort(viewPort); // We ignore the redundant width/height on the ROI